<? session_start();
require "../../../global.php";//$dirname."/".
require $SystemConest[0]."/"."inc/config.php";
require $SystemConest[0]."/"."inc/Uifunction.php";
require $SystemConest[0]."/".$SystemConest[1]."/System/Config.php";
require $SystemConest[0]."/".$SystemConest[1]."/UIFunction/adminClass.php";
require $SystemConest[0]."/".$SystemConest[1]."/System/MenuSys/function.php";
require$SystemConest[0]."/".$SystemConest[1]."/System/ClassSys/function.php";
?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>保存密码</title>
<link href="/Inc/Css.css" rel="stylesheet" type="text/css">
</head>

<body>
<?
    
$mydb=new YYBDB();
CheckRule($MenuId,$mydb,$SystemTablename[1],"");//检查登陆权限
$AdminFields=array();

$OldPwd=$_REQUEST["OldPwd"];
	if(trim($OldPwd)=="") $OldPwd="";
	$NewPwd=$_REQUEST["NewPWD"];
	$RPwd=$_REQUEST["RPWD"];
	 if(md5($OldPwd)==$_SESSION["Login"][2])
	 {
		if(strlen($NewPwd)>4 && strlen($NewPwd)<=17)
		{
			if($NewPwd==$RPwd)
			{
				
				$AdminFields[0]=$_SESSION["Login"][0];
				$AdminFields[2]=md5($_REQUEST["NewPWD"]);
				$mydb->TableName=$SystemTablename[1];
				$mydb->ArrFields=$AdminFields;
				$mydb->Update();
				$MyError=0;
				$Msg="";
				
			}
			else
			{
				$Msg= ".密码输入不一致！";
				$MyError=1;
			}
		}
		
	 }
	 else
	 {
	 	 $Msg=".旧密码输入错误！";
		$MyError=1;
	 }
	 
if($MyError==1)
{
	MessgBox("/".$SystemConest[1]."/Iamges/Error.jpg",$Msg,"ModifyPassWord.php");
}
else
{
	MessgBox("/".$SystemConest[1]."/Iamges/Right.jpg",$Msg,"ModifyPassWord.php");
}


  
  ?>
</body>
</html>
